package mars.activity;
import java.io.StringReader;

import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import bear.download.Circleread;
import bear.download.Friendsread;
import bear.download.HttpsUtils;
import bear.download.Msgread;
import bear.download.Nameread;
import bear.download.ULread;
import bear.download.Userread;
import android.app.Activity;  
import android.content.Intent;  
import android.os.Bundle;  
import android.os.Handler;  
  
  
public class Qidong extends Activity{  
@Override  
public void onCreate(Bundle savedInstanceState) {  
    super.onCreate(savedInstanceState);  
    setContentView(R.layout.zqq);  
      
    new Handler().postDelayed(new Runnable(){   // 为了减少代码使用匿名Handler创建一个延时的调用   
        public void run() {
        	HttpsUtils un=new HttpsUtils();
    		String nameUrl3=un.get("https://www.loushiapp.com/?c=login&a=hash2username&hash="+landActivity.hash);
    		try{
    			SAXParserFactory unr = SAXParserFactory.newInstance();
    			XMLReader reader=unr.newSAXParser().getXMLReader();
    			reader.setContentHandler(new Nameread());
    			reader.parse(new InputSource(new StringReader(nameUrl3)));
    		}catch(Exception e){
    			e.printStackTrace();
    		}			   
    		HttpsUtils cc=new HttpsUtils();
    		String ccUrl3=cc.get("https://www.loushiapp.com/?c=ls&a=getls&hash="+landActivity.hash);
    		try{
    			SAXParserFactory ccs = SAXParserFactory.newInstance();
    			XMLReader reader=ccs.newSAXParser().getXMLReader();
    			reader.setContentHandler(new Friendsread());
    			reader.parse(new InputSource(new StringReader(ccUrl3)));
    		}catch(Exception e){
    			e.printStackTrace();
    		}			   
    		
			HttpsUtils huto=new HttpsUtils();			
			String shareUrl=huto.get("https://www.loushiapp.com/?c=say&a=getothers&hash="+landActivity.hash);
			try{
				SAXParserFactory shareidea = SAXParserFactory.newInstance();
				XMLReader reader=shareidea.newSAXParser().getXMLReader();
				reader.setContentHandler(new Userread());
				reader.parse(new InputSource(new StringReader(shareUrl)));
			}catch(Exception e){
				e.printStackTrace();
			}
			HttpsUtils jin=new HttpsUtils();
			String circleUrl=jin.get("https://www.loushiapp.com/?c=say&a=getsay&hash="+landActivity.hash);
			try{
				SAXParserFactory cu = SAXParserFactory.newInstance();
				XMLReader reader=cu.newSAXParser().getXMLReader();
				reader.setContentHandler(new Circleread());
				reader.parse(new InputSource(new StringReader(circleUrl)));
			}catch(Exception e){
				e.printStackTrace();
			}
			HttpsUtils use=new HttpsUtils();
			String userUrl=use.get("https://www.loushiapp.com/?c=pm&a=getreceiver&hash="+landActivity.hash);
			try{
				SAXParserFactory cu = SAXParserFactory.newInstance();
				XMLReader reader=cu.newSAXParser().getXMLReader();
				reader.setContentHandler(new ULread());
				reader.parse(new InputSource(new StringReader(userUrl)));
			}catch(Exception e){
				e.printStackTrace();
			}
			HttpsUtils mesg=new HttpsUtils();
			String rmUrl=mesg.get("https://www.loushiapp.com/?c=pm&a=getpm&hash="+landActivity.hash);
			try{
				SAXParserFactory shou = SAXParserFactory.newInstance();
				XMLReader reader=shou.newSAXParser().getXMLReader();
				reader.setContentHandler(new Msgread());
				reader.parse(new InputSource(new StringReader(rmUrl)));
			}catch(Exception e){
				e.printStackTrace();
			}
            Intent i = new Intent(Qidong.this, User.class);    //通过Intent打开最终真正的主界面Main这个Activity   
            Qidong.this.startActivity(i);    //启动Main界面   
            finish();    //关闭自己这个开场屏   
        }     
    }, 3000);   //3秒，够用了吧     
}  
} 
